#define _CRT_SECURE_NO_WARNINGS
#include"list.h";

namespace my_list
{
	
	//list<int> l;
	//int* it = l.begin();
	//while (it != l.end())
	//{
	//	cout << *it << " ";
	//	++it;
	//}
	//cout << endl;
	
	void test1()
	{
		list<int> l1;
		l1.push_back(1);
		l1.push_back(2);
		l1.push_back(3);
		l1.push_back(4);
		l1.push_back(5);
		l1.push_back(6);
		l1.push_back(7);
		l1.push_back(8);

		l1.pop_back();
		l1.pop_back();

		l1.push_front(60);
		l1.push_front(70);
		l1.push_front(80);

		list<int>::iterator it = l1.begin();
		while (it != l1.end())
		{
			cout << *it << " ";
			++it;
		}
		cout << endl;			
	}

	void test2()
	{
		list<int> l1;

		l1.insert(l1.begin(), 10);
		l1.insert(++l1.begin(), 1);
		l1.insert(++l1.begin(), 2);
		l1.insert(++l1.begin(), 3);
		l1.insert(l1.begin(), 4);
		l1.insert(l1.end(), 5);
		l1.insert(--l1.end(), 6);

		l1.erase(--l1.end());
		l1.erase(l1.begin());

	/*	int a = l1.front();
		cout << a << endl;
		a = l1.back();
		cout << a << endl;*/

		

		list<int>::iterator it = l1.begin();
		while (it != l1.end())
		{
			cout << *it << " ";
			++it;
		}
		cout << endl;

	}

	void test3()
	{
		list<int> l1;
		l1.push_back(1);
		l1.push_back(2);
		l1.push_back(3);
		l1.push_back(4);
		/*l1.push_back(5);
		l1.push_back(6);
		l1.push_back(7);
		l1.push_back(8);*/

		list<int>::iterator it = l1.begin();
		while (it != l1.end())
		{
			cout << *it << " ";
			++it;
		}
		cout << endl;

		l1.clear();
		it = l1.begin();
		while (it != l1.end())
		{
			cout << *it << " ";
			++it;
		}
		cout << endl;

		l1.push_back(5);
		l1.push_back(6);
		l1.push_back(7);
		l1.push_back(8);

		it = l1.begin();
		while (it != l1.end())
		{
			cout << *it << " ";
			++it;
		}
		cout << endl;
	}

	void test4()
	{
		list<int> l1(10, 5);

		/*list<int>::iterator it = l1.begin();
		while (it != l1.end())
		{
			cout << *it << " ";
			++it;
		}
		cout << endl;*/

		list<int> l2 = l1;
		list<int>::iterator it = l2.begin();
		while (it != l2.end())
		{
			cout << *it << " ";
			++it;
		}
	}
}

int main()
{
	my_list::test4();
	return 0;
}